Add destroy_dev() function as a counterpart to create_dev()#466
Add destroy_dev() function as a counterpart to create_dev()#466julianuziemblo wants to merge 4 commits intomasterfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the system's device and port management by introducing explicit functions for unregistering devices and ports. This new functionality improves resource cleanup and system stability, particularly in dynamic environments where devices are frequently added and removed, by providing a structured way to remove device entries. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new remove_dev function and declares portUnregister for device removal. The implementation of remove_dev is mostly correct, but I've found a bug in how it handles path prefixes which could lead to incorrect behavior. I've also noted an inconsistency in error handling compared to similar functions in the same file. My review includes suggestions to address these issues.
ad281e5 to
066b430
Compare
|
I would rather see |
I agree with your suggestions, but it seems like they should he handled in separate PR as they are big and very breaking. This PR only adds missing functionality as a basis for drivers that need it now to work without creating excessive overhead (e.g. spawning cleanup threads just to take care of deleting their own devs). |
585aecd to
066b430
Compare
agkaminski
left a comment
There was a problem hiding this comment.
One nitpick, otherwise LGTM
066b430 to
fb718ea
Compare
fb718ea to
417af95
Compare
add8987 to
94e003f
Compare
94e003f to
a3a1cce
Compare
a3a1cce to
694d089
Compare
2e754d2 to
56d6117
Compare
destroy_dev() is a counterpart to create_dev() that allows for device removal without sending messages back to the calling port unlike remove()/unlink() functions YT: RTOS-1254
To make destroy_dev() resemble create_dev(), a fallback was added to unregister the port in the case we don't have a filesystem. YT: RTOS-1254
… syscalls YT: RTOS-1254
YT: RTOS-1254
56d6117 to
2b7f7e9
Compare
Description
Motivation and Context
Depends-On: phoenix-rtos-kernel:julianuziemblo/port-unregister
Types of changes
How Has This Been Tested?
armv7m7-imxrt117x-evkChecklist:
Special treatment